package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class TwoPathsTheSameFileOrFolder {
	public static void main(String[] args) {
		Path path01 = Paths.get("/folder1/folder2/folder3/test.txt");
		Path path02 = Paths.get("C:/folder1/folder2/folder3/test.txt");

		try {
			boolean check = Files.isSameFile(path01, path02);
			if (check) {
				System.out.println("是同一个文件!");
			} else {
				System.out.println("不是同一个文件!");
			}
		} catch (IOException e) {
			System.out.println(e);
		}

	}
}
